<%@ page contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>物资采购与产品整合管理系统</title>
<link href="${pageContext.request.contextPath }/css/main.css"
	rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src='<c:url value="/js/jquery-1.11.1.js"></c:url>'></script>
<script src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
	<script>
		$(function () {
			$("#billflag").change(function () {
				$.ajax({
					url:"${pageContext.request.contextPath}/retory.do?op=ajaxquery",
					type:"post",
					data:"billflag="+$("#billflag").val(),
					dataType:"json",
					success:function (result) {

						$("#billtype>option").remove(":not(:first)");
						for (var i=0;i<result.length;i++){
							$("#billtype").append("<option value="+result[i].code+">"+result[i].name+"</option>")
						}
					}
				})
			})
		})
	</script>

</head>

<body class="content-pages-body">
	<div class="content-pages-wrap">
		<div class="commonTitle">
			<h2>&gt;&gt; 配件库存流水账查询</h2>
		</div>
		<table width="100%" border="0" cellspacing="0" cellpadding="0"
			class="commonTableSearch">
			<form id="form-search" name="form-search" action="${pageContext.request.contextPath}/retory.do?op=querybill" method="post">
				<tr>
					<th align="right">配件名称：</th>
					<td><input name="partsName" type="text"
						class="inputTextNormal" id="partsName" value="${partsName}"/></td>
					<th align="right">出/入库：</th>
					<td><select style="width: 150px;" name="billflag" id="billflag" value="${billflag}">
							<option value="">---请选择----</option>
						    <option value="in">入库</option>
						    <option value="out">出库</option>

					</select></td>
					<th align="right">出入库类型：</th>
					<td><select style="width: 150px;" name="billtype" id="billtype" value="${billtype}">
							<option value="">----请选择----</option>
					</select></td>
					<th align="right">出入库日期：</th>
					<td><input  name="billtime" type="text"  id="billtime"
						class="inputTextNormal" value="${billtime}"/></td>
					<th align="right"><input type="submit" class="btnShort"
						value="检索" /></th>
				</tr>
			</form>
		</table>
		<br>

		<!--//commonTableSearch-->

		<table width="101%" border="0" cellpadding="0" cellspacing="1"
			class="commonTable">
			<tr>
				<th>序号</th>
				<th>出/入库</th>
				<th>出入库类别</th>
				<th>配件名称</th>
				<th>数量</th>
				<th>时间</th>
				<th>操作人</th>
			</tr>
			<c:forEach items="${pageInfo.list}" var="bill" varStatus="status">
		<tr>
            <td align="center">${status.index+1}</td>
            <td align="center">${bill.billflag}</td>
            <td align="center">${bill.billtype}</td>
			<td align="center">${bill.partsname}</td>
			<td align="center">${bill.billcount}</td>
			<td align="center">${bill.billtime}</td>
			<td align="center">${bill.billuser}</td>
        </tr>
			</c:forEach>
		</table>
		<!--//commonTable-->
		<div>
			<%@include file="/page/common/subpage.jsp"%>
		</div>
	</div>
	<!--//content pages wrap-->
</body>
</html>